R Basic

Introduction

R as a calculator

1 + 100
2^2
7/2
4-1
2*2
3+5*2
(3+5)*2
2e2
2/10000
sin(1)
log(1)
exp(0)
1 == 1
1 >= 1
1 < 1
1 != 2
x <- 10
x
x + x
x - 5
x^2
y <- x + x
y

Vectorization

1:5
2^(1:5)
v <- 1:5
2^v
log10(v)

Environment

ls()
rm(v)
ls()

Package Management

installed.packages()
#install.packages("vegan", dependencies = TRUE) #Already installed
library(vegan)
#remove.packages()

Project Management

  1. Set up management structure (i.e., “data”, “src”, “results”, “doc”)
  2. Discuss avoiding redundancy of files
  3. Make sure to use version control (i.e., Git)

Getting Help

?plot
help(plot)
?"<-"
vignette("FAQ-vegan")
citation("vegan")

To cite package ‘vegan’ in publications use:

  Jari Oksanen, F. Guillaume Blanchet, Michael Friendly, Roeland Kindt, Pierre Legendre, Dan McGlinn, Peter R.
  Minchin, R. B. O'Hara, Gavin L. Simpson, Peter Solymos, M. Henry H. Stevens, Eduard Szoecs and Helene Wagner
  (2020). vegan: Community Ecology Package. R package version 2.5-7. https://CRAN.R-project.org/package=vegan

A BibTeX entry for LaTeX users is

  @Manual{,
    title = {vegan: Community Ecology Package},
    author = {Jari Oksanen and F. Guillaume Blanchet and Michael Friendly and Roeland Kindt and Pierre Legendre and Dan McGlinn and Peter R. Minchin and R. B. O'Hara and Gavin L. Simpson and Peter Solymos and M. Henry H. Stevens and Eduard Szoecs and Helene Wagner},
    year = {2020},
    note = {R package version 2.5-7},
    url = {https://CRAN.R-project.org/package=vegan},
  }

ATTENTION: This citation information has been auto-generated from the package DESCRIPTION file and may need
manual editing, see ‘help("citation")’.

Data and their formats

cats <- data.frame(coat = c("calico", "black", "tabby"),
                   weight = c(2.1,5,3.2),
                   likes_string = c(1,0,1))
write.csv(cats, file = "~/GitHub/biol48006220_Fall2022/practcomp_2022/data/cats.csv")
cats$coat
[1] "calico" "black"  "tabby" 
cats$weight
[1] 2.1 5.0 3.2
cats$weight*10
[1] 21 50 32
log(cats$weight)
[1] 0.7419373 1.6094379 1.1631508
cats <- cbind(cats, logweight)
paste("My cat is ", cats$coat, ", and it weighs ", cats$weight, " kg.", sep = "")
[1] "My cat is calico, and it weighs 2.1 kg." "My cat is black, and it weighs 5 kg."   
[3] "My cat is tabby, and it weighs 3.2 kg." 

Data Types

typeof(cats$coat)
[1] "character"
typeof(cats$weight)
[1] "double"
typeof(cats$likes_string)
[1] "double"
typeof(3.14159)
[1] "double"
typeof(1i)
[1] "complex"
typeof(FALSE)
[1] "logical"
typeof(T)
[1] "logical"
typeof(cats)
[1] "list"
class(cats)
[1] "data.frame"
file.show("./data/cats.csv")
typeof(cats$likes_string)
[1] "logical"
cats$likes_string
[1]  TRUE FALSE  TRUE
c("a", "b")
[1] "a" "b"
ab
[1] "a" "b"
c(ab, "c")
[1] "a" "b" "c"
c(ab, ab)
[1] "a" "b" "a" "b"
1:10
 [1]  1  2  3  4  5  6  7  8  9 10
seq(10)
 [1]  1  2  3  4  5  6  7  8  9 10
head(z, n=3)
[1] 1 2 3
length(z)
[1] 10
class(z)
[1] "integer"
typeof(z)
[1] "integer"
seq(0,100, by=5)
 [1]   0   5  10  15  20  25  30  35  40  45  50  55  60  65  70  75  80  85  90  95 100

Data Frames

str(cats$coat)
 chr [1:3] "calico" "black" "tabby"
coats
[1] "tabby"         "tortoiseshell" "tortoiseshell" "black"         "tabby"        
str(coats)
 chr [1:5] "tabby" "tortoiseshell" "tortoiseshell" "black" "tabby"
factor(coats)
[1] tabby         tortoiseshell tortoiseshell black         tabby        
Levels: black tabby tortoiseshell
class(categories)
[1] "factor"
str(categories)
 Factor w/ 3 levels "black","tabby",..: 2 3 3 1 2

Lists

list_example <- list(title="Numbers", numbers = 1:10, data=T)
list_example
$title
[1] "Numbers"

$numbers
 [1]  1  2  3  4  5  6  7  8  9 10

$data
[1] TRUE
another_list
[[1]]
[1] 1

[[2]]
[1] "a"

[[3]]
[1] TRUE

[[4]]
[1] 1+1i
class(list_example)
[1] "list"
class(cats)
[1] "data.frame"

Matrices

# By definition, matrices are all numbers

matrix_example <- matrix(0, ncol = 5, nrow = 3)
matrix_example
class(matrix_example)
typeof(matrix_example)
str(matrix_example)
dim(matrix_example)
ncol(matrix_example)
nrow(matrix_example)
class(data.frame(matrix_example))
df_example <- data.frame(matrix_example)
df_example

Subsetting

p <- c(2.3, 6.9, 4.0, 23, 1)
p
names(p) <- c('a', 'b', 'c', 'd', 'e')
p
p[1]
p[2:4]
p[c(1,5)]
p[c(1,1,1,3,5,5)]
p[6]
p[-3]
p[c(-1,-5)]
p[-(2:4)]
p[c('a','c')]
p[c(T,F,T,F,T)]
p[names(p) != 'c']

Factors

f <- factor(c('a','b','c','d','e'))
f
f[f=='a']
f[1:3]
f[f %in% c('b','c')]
f[-3]
f2 <- factor(c('a','a','d','c','c'))
f2
f2[f2 == 'a']
f2[f2 %in% c('a','c')]

Matrices Resumed

m
           [,1]       [,2]       [,3]        [,4]
[1,] -1.1968205 -0.3943568  0.4232027 -2.34367583
[2,] -0.9516674 -1.2484030 -1.8461725 -0.77605977
[3,]  0.2786364 -0.6521289 -0.2456747 -2.16173144
[4,] -1.4449411 -1.1707346  1.2538299  0.05701057
[5,]  0.8216518  0.3604497  1.5633419 -0.24867199
[6,]  1.2470188  1.2302708 -1.2644661 -0.07830796
m[,c(3,4)]
           [,1]        [,2]
[1,]  0.4232027 -2.34367583
[2,] -1.8461725 -0.77605977
[3,] -0.2456747 -2.16173144
[4,]  1.2538299  0.05701057
[5,]  1.5633419 -0.24867199
[6,] -1.2644661 -0.07830796

Lists Revisted

xlist
$a
[1] "BIOL48006220"

$b
 [1]  1.0  1.5  2.0  2.5  3.0  3.5  4.0  4.5  5.0  5.5  6.0  6.5  7.0  7.5  8.0  8.5  9.0  9.5 10.0

$data
[1] "Grade"
xlist[1:2]
$a
[1] "BIOL48006220"

$b
 [1]  1.0  1.5  2.0  2.5  3.0  3.5  4.0  4.5  5.0  5.5  6.0  6.5  7.0  7.5  8.0  8.5  9.0  9.5 10.0
xlist['a']
$a
[1] "BIOL48006220"
xlist[['a']]
[1] "BIOL48006220"
xlist[['b']]
 [1]  1.0  1.5  2.0  2.5  3.0  3.5  4.0  4.5  5.0  5.5  6.0  6.5  7.0  7.5  8.0  8.5  9.0  9.5 10.0
xlist$b
 [1]  1.0  1.5  2.0  2.5  3.0  3.5  4.0  4.5  5.0  5.5  6.0  6.5  7.0  7.5  8.0  8.5  9.0  9.5 10.0

Data Frames Revisted

gp <- read.csv("/Users/colinfinlay/GitHub/biol48006220_Fall2022/practcomp_2022/data/forest_area_sq_km.numbers")
Warning: line 1 appears to contain embedded nullsWarning: line 3 appears to contain embedded nullsWarning: line 4 appears to contain embedded nullsWarning: line 5 appears to contain embedded nullsWarning: EOF within quoted stringWarning: embedded nul(s) found in input
head(gp, n=10L)
Warning messages:
1: replacing previous import ‘lifecycle::last_warnings’ by ‘rlang::last_warnings’ when loading ‘tibble’ 
2: replacing previous import ‘lifecycle::last_warnings’ by ‘rlang::last_warnings’ when loading ‘pillar’ 
nrow(gp)
[1] 214
head(gp[["country"]], 10L)
 [1] "Aruba"                "Afghanistan"          "Angola"               "Albania"              "Andorra"             
 [6] "United Arab Emirates" "Argentina"            "Armenia"              "American Samoa"       "Antigua and Barbuda" 
gp$X2001
  [1] "4.2"   "12.1k" "766k"  "7720"  "160"   "3110"  "327k"  "3320"  "177"   "93.2"  "1.31M" "38.4k" "9960"  "1940"  "6720" 
 [16] "40.4k" "71.2k" "19.1k" "34.5k" "4"     "5100"  "21.1k" "83.4k" "14.5k" "10"    "547k"  "5.43M" "63"    "3940"  "26.3k"
 [31] "174k"  "228k"  "3.48M" "8.68"  "12k"   "160k"  "1.82M" "48.7k" "215k"  "1.43M" "222k"  "623k"  "408"   "403"   "28.6k"
 [46] "25.3k" "129"   "1720"  "26.4k" "114k"  "56"    "479"   "5750"  "19.9k" "16.5k" "136k"  "605"   "11.1k" "174k"  "22.6k"
 [61] "184k"  "224k"  "10.2k" "155k"  "0.8"   "639"   "237k"  "34.6"  "29.8k" "27.7k" "86.7k" "0"     "68.6k" "3460"  "21.3k"
 [76] "26k"   "36.6k" "177"   "2.2"   "41.1k" "240"   "186k"  "67.4k" "18.9k" "3800"  "19.5k" "1.01M" "680k"  "6480"  "96k"  
 [91] "8190"  "328"   "1530"  "85k"   "5280"  "975"   "249k"  "31.4k" "38.9k" "11.9k" "107k"  "11.8"  "110"   "64.6k" "51.3" 
[106] "173k"  "1380"  "81.6k" "2170"  "210"   "67"    "21.5k" "345"   "20.5k" "871"   "32.7k" "10"    "55.4k" "0"     "3500" 
[121] "129k"  "8.2"   "681k"  "94"    "9580"  "133k"  "3.5"   "342k"  "6260"  "142k"  "316"   "407k"  "4110"  "412"   "30k"  
[136] "195k"  "79.2k" "8380"  "13k"   "246k"  "51.6k" "3620"  ""      "121k"  "58.2k" "0"     "98.5k" "30"    "44.3k" "44.2k"
[151] "750k"  "72.2k" "398"   "363k"  "91.1k" "4420"  "64.1k" "32.8k" "223k"  "91.2"  "1490"  "0"     "64k"   "8.1M"  "2830" 
[166] "9770"  ""      "87.8k" "172"   "25.4k" "28.9k" "6650"  "10"    "73.6k" "24.8k" ""      "583"   "153k"  "19k"   "12.4k"
[181] "281k"  "4760"  ""      "337"   "4440"  "105"   "61.9k" "12.6k" "192k"  "4100"  "41.3k" "9460"  "89.5"  "2360"  "6720" 
[196] "203k"  "10"    "529k"  "30.8k" "95.2k" "14.4k" "3.05M" "30.4k" "285"   "488k"  "36.6"  "201"   "121k"  "4420"  "1700" 
[211] "5490"  "177k"  "470k"  "183k" 

Conditionals and Flow

if (n<10) {
  print("n is less than 10")
} else if (n>10) {
  print("n is greater than 10")
} else {
  print("n is equal to 10")
}
[1] "n is equal to 10"
for (n in seq(1,20)) {
  if (n<10) {
    print("n is less than 10")
  } else if (n>10) {
    print("n is greater than 10")
  } else {
   print("n is equal to 10")
  }
}
[1] "n is less than 10"
[1] "n is less than 10"
[1] "n is less than 10"
[1] "n is less than 10"
[1] "n is less than 10"
[1] "n is less than 10"
[1] "n is less than 10"
[1] "n is less than 10"
[1] "n is less than 10"
[1] "n is equal to 10"
[1] "n is greater than 10"
[1] "n is greater than 10"
[1] "n is greater than 10"
[1] "n is greater than 10"
[1] "n is greater than 10"
[1] "n is greater than 10"
[1] "n is greater than 10"
[1] "n is greater than 10"
[1] "n is greater than 10"
[1] "n is greater than 10"
while (g <=10) {
  print(paste(g, "is less than or equal to 10"))
  g <- g+1
}
[1] "0 is less than or equal to 10"
[1] "1 is less than or equal to 10"
[1] "2 is less than or equal to 10"
[1] "3 is less than or equal to 10"
[1] "4 is less than or equal to 10"
[1] "5 is less than or equal to 10"
[1] "6 is less than or equal to 10"
[1] "7 is less than or equal to 10"
[1] "8 is less than or equal to 10"
[1] "9 is less than or equal to 10"
[1] "10 is less than or equal to 10"

Plotting

library(ggplot2)

africas <- gapminder[gapminder$continent=="Africa", ]
ggplot(data=africas, mapping = aes(x=year, y=lifeExp)) +
  geom_line() +
  facet_wrap(~country) +
  theme(axis.text.x = element_text(angle = 90)) +
  labs(
    x = "Year",
    y = "Life Expectancy",
    title = "Life Expectancy Over Time in African Countries"
  )

ggsave(filename = "./data/AfricanLifeExp.png", plot = AfricanLifeExp, width = 24, height = 40, dpi = 300, units = "cm")
Error in grDevices::dev.off() : 
  QuartzBitmap_Output - unable to open file './data/AfricanLifeExp.png'
pdf(file = "/Users/colinfinlay/GitHub/biol48006220_Fall2022/practcomp_2022/results/AfricanLifeExp.pdf", width = 24, height = 40)
plot(AfricanLifeExp)
dev.off()
null device 
          1 
write.table(gapminder, file="/data/gapminder_web.csv", sep = ",")
Warning: cannot open file '/data/gapminder_web.csv': No such file or directoryError in file(file, ifelse(append, "a", "w")) : 
  cannot open the connection
write.csv(africas, file="/Users/colinfinlay/GitHub/biol48006220_Fall2022/practcomp_2022/data/gapminder_web_africas.csv")

Fancy Plots

install.packages(c("ggridges", "viridis", "hrbrthemes"), dependencies = T)
also installing the dependencies ‘deldir’, ‘lazyeval’, ‘png’, ‘jpeg’, ‘interp’, ‘rex’, ‘sp’, ‘terra’, ‘latticeExtra’, ‘systemfonts’, ‘extrafontdb’, ‘Rttf2pt1’, ‘covr’, ‘patchwork’, ‘ggplot2movies’, ‘vdiffr’, ‘hexbin’, ‘dichromat’, ‘raster’, ‘rasterVis’, ‘mapproj’, ‘svglite’, ‘rgdal’, ‘maps’, ‘extrafont’, ‘gdtools’, ‘hunspell’, ‘gcookbook’

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/deldir_1.0-6.tgz'
Content type 'application/x-gzip' length 302125 bytes (295 KB)
==================================================
downloaded 295 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/lazyeval_0.2.2.tgz'
Content type 'application/x-gzip' length 157457 bytes (153 KB)
==================================================
downloaded 153 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/png_0.1-7.tgz'
Content type 'application/x-gzip' length 369727 bytes (361 KB)
==================================================
downloaded 361 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/jpeg_0.1-9.tgz'
Content type 'application/x-gzip' length 416927 bytes (407 KB)
==================================================
downloaded 407 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/interp_1.1-3.tgz'
Content type 'application/x-gzip' length 5406572 bytes (5.2 MB)
==================================================
downloaded 5.2 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/rex_1.2.1.tgz'
Content type 'application/x-gzip' length 122412 bytes (119 KB)
==================================================
downloaded 119 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/sp_1.5-0.tgz'
Content type 'application/x-gzip' length 1834165 bytes (1.7 MB)
==================================================
downloaded 1.7 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/terra_1.6-17.tgz'
Content type 'application/x-gzip' length 96245728 bytes (91.8 MB)
==================================================
downloaded 91.8 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/latticeExtra_0.6-30.tgz'
Content type 'application/x-gzip' length 2204020 bytes (2.1 MB)
==================================================
downloaded 2.1 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/systemfonts_1.0.4.tgz'
Content type 'application/x-gzip' length 5879392 bytes (5.6 MB)
==================================================
downloaded 5.6 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/extrafontdb_1.0.tgz'
Content type 'application/x-gzip' length 6987 bytes
==================================================
downloaded 6987 bytes

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/Rttf2pt1_1.3.11.tgz'
Content type 'application/x-gzip' length 106028 bytes (103 KB)
==================================================
downloaded 103 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/covr_3.6.1.tgz'
Content type 'application/x-gzip' length 325440 bytes (317 KB)
==================================================
downloaded 317 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/patchwork_1.1.2.tgz'
Content type 'application/x-gzip' length 3235669 bytes (3.1 MB)
==================================================
downloaded 3.1 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/ggplot2movies_0.0.1.tgz'
Content type 'application/x-gzip' length 1248034 bytes (1.2 MB)
==================================================
downloaded 1.2 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/vdiffr_1.0.4.tgz'
Content type 'application/x-gzip' length 1070374 bytes (1.0 MB)
==================================================
downloaded 1.0 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/hexbin_1.28.2.tgz'
Content type 'application/x-gzip' length 1471267 bytes (1.4 MB)
==================================================
downloaded 1.4 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/dichromat_2.0-0.1.tgz'
Content type 'application/x-gzip' length 146933 bytes (143 KB)
==================================================
downloaded 143 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/raster_3.6-3.tgz'
Content type 'application/x-gzip' length 4771584 bytes (4.6 MB)
==================================================
downloaded 4.6 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/rasterVis_0.51.2.tgz'
Content type 'application/x-gzip' length 212016 bytes (207 KB)
==================================================
downloaded 207 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/mapproj_1.2.8.tgz'
Content type 'application/x-gzip' length 83346 bytes (81 KB)
==================================================
downloaded 81 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/svglite_2.1.0.tgz'
Content type 'application/x-gzip' length 918168 bytes (896 KB)
==================================================
downloaded 896 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/rgdal_1.5-32.tgz'
Content type 'application/x-gzip' length 86550225 bytes (82.5 MB)
==================================================
downloaded 82.5 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/maps_3.4.0.tgz'
Content type 'application/x-gzip' length 3105764 bytes (3.0 MB)
==================================================
downloaded 3.0 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/extrafont_0.18.tgz'
Content type 'application/x-gzip' length 54152 bytes (52 KB)
==================================================
downloaded 52 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/gdtools_0.2.4.tgz'
Content type 'application/x-gzip' length 1921424 bytes (1.8 MB)
==================================================
downloaded 1.8 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/hunspell_3.0.2.tgz'
Content type 'application/x-gzip' length 2473165 bytes (2.4 MB)
==================================================
downloaded 2.4 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/gcookbook_2.0.tgz'
Content type 'application/x-gzip' length 4012352 bytes (3.8 MB)
==================================================
downloaded 3.8 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/ggridges_0.5.4.tgz'
Content type 'application/x-gzip' length 2254162 bytes (2.1 MB)
==================================================
downloaded 2.1 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/viridis_0.6.2.tgz'
Content type 'application/x-gzip' length 2998780 bytes (2.9 MB)
==================================================
downloaded 2.9 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/hrbrthemes_0.8.0.tgz'
Content type 'application/x-gzip' length 2291025 bytes (2.2 MB)
==================================================
downloaded 2.2 MB

The downloaded binary packages are in
    /var/folders/r1/3zp0c6w516g61fbl6pqcz7gr0000gn/T//RtmpKhjam5/downloaded_packages
hrbrthemes::import_roboto_condensed()
sh: line 1:  1576 Segmentation fault: 11  '/Library/Frameworks/R.framework/Versions/4.2/Resources/library/Rttf2pt1/exec//ttf2pt1' -a -GfAe '/Library/Frameworks/R.framework/Versions/4.2/Resources/library/hrbrthemes/fonts/roboto-condensed/RobotoCondensed-Bold.ttf' '/var/folders/r1/3zp0c6w516g61fbl6pqcz7gr0000gn/T//RtmpKhjam5/fonts/RobotoCondensed-Bold' 2>&1
sh: line 1:  1578 Segmentation fault: 11  '/Library/Frameworks/R.framework/Versions/4.2/Resources/library/Rttf2pt1/exec//ttf2pt1' -a -GfAe '/Library/Frameworks/R.framework/Versions/4.2/Resources/library/hrbrthemes/fonts/roboto-condensed/RobotoCondensed-Light.ttf' '/var/folders/r1/3zp0c6w516g61fbl6pqcz7gr0000gn/T//RtmpKhjam5/fonts/RobotoCondensed-Light' 2>&1
sh: line 1:  1580 Segmentation fault: 11  '/Library/Frameworks/R.framework/Versions/4.2/Resources/library/Rttf2pt1/exec//ttf2pt1' -a -GfAe '/Library/Frameworks/R.framework/Versions/4.2/Resources/library/hrbrthemes/fonts/roboto-condensed/RobotoCondensed-Regular.ttf' '/var/folders/r1/3zp0c6w516g61fbl6pqcz7gr0000gn/T//RtmpKhjam5/fonts/RobotoCondensed-Regular' 2>&1
You will likely need to install these fonts on your system as well.

You can find them in [/Library/Frameworks/R.framework/Versions/4.2/Resources/library/hrbrthemes/fonts/roboto-condensed]

Statistics

install.packages(c("ggstatsplot", "palmerpenguins"), dependencies = T)
also installing the dependencies ‘listenv’, ‘parallelly’, ‘future’, ‘globals’, ‘future.apply’, ‘progressr’, ‘SQUAREM’, ‘checkmate’, ‘matrixStats’, ‘RcppGSL’, ‘lava’, ‘elliptic’, ‘contfrac’, ‘deSolve’, ‘Brobdingnag’, ‘inline’, ‘loo’, ‘pkgbuild’, ‘bdsmatrix’, ‘RcppZiggurat’, ‘iterators’, ‘rngtools’, ‘prodlim’, ‘bayestestR’, ‘prismatic’, ‘effectsize’, ‘zeallot’, ‘lmerTest’, ‘coda’, ‘hypergeo’, ‘bridgesampling’, ‘LaplacesDemon’, ‘logspline’, ‘RcppParallel’, ‘rstan’, ‘rstantools’, ‘BH’, ‘StanHeaders’, ‘metadat’, ‘mathjaxr’, ‘bbmle’, ‘fastGHQuad’, ‘Rfast’, ‘doParallel’, ‘foreach’, ‘doRNG’, ‘gmp’, ‘Rmpfr’, ‘SuppDists’, ‘kSamples’, ‘BWStest’, ‘mnormt’, ‘commonmark’, ‘reshape’, ‘mc2d’, ‘gower’, ‘hardhat’, ‘ipred’, ‘timeDate’, ‘correlation’, ‘datawizard’, ‘insight’, ‘paletteer’, ‘parameters’, ‘performance’, ‘statsExpressions’, ‘afex’, ‘BayesFactor’, ‘gapminder’, ‘ggcorrplot’, ‘ggside’, ‘metaBMA’, ‘metafor’, ‘metaplus’, ‘PMCMRplus’, ‘psych’, ‘spelling’, ‘WRS2’, ‘recipes’

  There is a binary version available but the source version is later:
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/listenv_0.8.0.tgz'
Content type 'application/x-gzip' length 103223 bytes (100 KB)
==================================================
downloaded 100 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/parallelly_1.32.1.tgz'
Content type 'application/x-gzip' length 302748 bytes (295 KB)
==================================================
downloaded 295 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/future_1.28.0.tgz'
Content type 'application/x-gzip' length 656510 bytes (641 KB)
==================================================
downloaded 641 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/globals_0.16.1.tgz'
Content type 'application/x-gzip' length 106135 bytes (103 KB)
==================================================
downloaded 103 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/future.apply_1.9.1.tgz'
Content type 'application/x-gzip' length 151535 bytes (147 KB)
==================================================
downloaded 147 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/progressr_0.11.0.tgz'
Content type 'application/x-gzip' length 272289 bytes (265 KB)
==================================================
downloaded 265 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/SQUAREM_2021.1.tgz'
Content type 'application/x-gzip' length 176568 bytes (172 KB)
==================================================
downloaded 172 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/checkmate_2.1.0.tgz'
Content type 'application/x-gzip' length 694554 bytes (678 KB)
==================================================
downloaded 678 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/matrixStats_0.62.0.tgz'
Content type 'application/x-gzip' length 590827 bytes (576 KB)
==================================================
downloaded 576 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/RcppGSL_0.3.11.tgz'
Content type 'application/x-gzip' length 1051782 bytes (1.0 MB)
==================================================
downloaded 1.0 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/elliptic_1.4-0.tgz'
Content type 'application/x-gzip' length 1257923 bytes (1.2 MB)
==================================================
downloaded 1.2 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/contfrac_1.1-12.tgz'
Content type 'application/x-gzip' length 27492 bytes (26 KB)
==================================================
downloaded 26 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/deSolve_1.34.tgz'
Content type 'application/x-gzip' length 2619125 bytes (2.5 MB)
==================================================
downloaded 2.5 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/Brobdingnag_1.2-9.tgz'
Content type 'application/x-gzip' length 1325577 bytes (1.3 MB)
==================================================
downloaded 1.3 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/inline_0.3.19.tgz'
Content type 'application/x-gzip' length 127274 bytes (124 KB)
==================================================
downloaded 124 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/loo_2.5.1.tgz'
Content type 'application/x-gzip' length 1589173 bytes (1.5 MB)
==================================================
downloaded 1.5 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/pkgbuild_1.3.1.tgz'
Content type 'application/x-gzip' length 143896 bytes (140 KB)
==================================================
downloaded 140 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/bdsmatrix_1.3-6.tgz'
Content type 'application/x-gzip' length 327026 bytes (319 KB)
==================================================
downloaded 319 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/RcppZiggurat_0.1.6.tgz'
Content type 'application/x-gzip' length 789626 bytes (771 KB)
==================================================
downloaded 771 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/iterators_1.0.14.tgz'
Content type 'application/x-gzip' length 345398 bytes (337 KB)
==================================================
downloaded 337 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/rngtools_1.5.2.tgz'
Content type 'application/x-gzip' length 76743 bytes (74 KB)
==================================================
downloaded 74 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/prodlim_2019.11.13.tgz'
Content type 'application/x-gzip' length 422363 bytes (412 KB)
==================================================
downloaded 412 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/bayestestR_0.13.0.tgz'
Content type 'application/x-gzip' length 1477700 bytes (1.4 MB)
==================================================
downloaded 1.4 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/prismatic_1.1.1.tgz'
Content type 'application/x-gzip' length 786489 bytes (768 KB)
==================================================
downloaded 768 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/effectsize_0.8.1.tgz'
Content type 'application/x-gzip' length 680142 bytes (664 KB)
==================================================
downloaded 664 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/zeallot_0.1.0.tgz'
Content type 'application/x-gzip' length 57961 bytes (56 KB)
==================================================
downloaded 56 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/lmerTest_3.1-3.tgz'
Content type 'application/x-gzip' length 529283 bytes (516 KB)
==================================================
downloaded 516 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/coda_0.19-4.tgz'
Content type 'application/x-gzip' length 321854 bytes (314 KB)
==================================================
downloaded 314 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/hypergeo_1.2-13.tgz'
Content type 'application/x-gzip' length 352373 bytes (344 KB)
==================================================
downloaded 344 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/bridgesampling_1.1-2.tgz'
Content type 'application/x-gzip' length 1723346 bytes (1.6 MB)
==================================================
downloaded 1.6 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/LaplacesDemon_16.1.6.tgz'
Content type 'application/x-gzip' length 4045413 bytes (3.9 MB)
==================================================
downloaded 3.9 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/logspline_2.1.17.tgz'
Content type 'application/x-gzip' length 272278 bytes (265 KB)
==================================================
downloaded 265 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/RcppParallel_5.1.5.tgz'
Content type 'application/x-gzip' length 612423 bytes (598 KB)
==================================================
downloaded 598 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/rstan_2.21.7.tgz'
Content type 'application/x-gzip' length 24545266 bytes (23.4 MB)
==================================================
downloaded 23.4 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/rstantools_2.2.0.tgz'
Content type 'application/x-gzip' length 155838 bytes (152 KB)
==================================================
downloaded 152 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/BH_1.78.0-0.tgz'
Content type 'application/x-gzip' length 12587148 bytes (12.0 MB)
==================================================
downloaded 12.0 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/StanHeaders_2.21.0-7.tgz'
Content type 'application/x-gzip' length 1546843 bytes (1.5 MB)
==================================================
downloaded 1.5 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/metadat_1.2-0.tgz'
Content type 'application/x-gzip' length 835673 bytes (816 KB)
==================================================
downloaded 816 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/mathjaxr_1.6-0.tgz'
Content type 'application/x-gzip' length 819566 bytes (800 KB)
==================================================
downloaded 800 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/bbmle_1.0.25.tgz'
Content type 'application/x-gzip' length 894088 bytes (873 KB)
==================================================
downloaded 873 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/fastGHQuad_1.0.1.tgz'
Content type 'application/x-gzip' length 199668 bytes (194 KB)
==================================================
downloaded 194 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/Rfast_2.0.6.tgz'
Content type 'application/x-gzip' length 11725745 bytes (11.2 MB)
==================================================
downloaded 11.2 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/doParallel_1.0.17.tgz'
Content type 'application/x-gzip' length 188349 bytes (183 KB)
==================================================
downloaded 183 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/foreach_1.5.2.tgz'
Content type 'application/x-gzip' length 136295 bytes (133 KB)
==================================================
downloaded 133 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/doRNG_1.8.2.tgz'
Content type 'application/x-gzip' length 279715 bytes (273 KB)
==================================================
downloaded 273 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/gmp_0.6-6.tgz'
Content type 'application/x-gzip' length 871583 bytes (851 KB)
==================================================
downloaded 851 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/Rmpfr_0.8-9.tgz'
Content type 'application/x-gzip' length 1558351 bytes (1.5 MB)
==================================================
downloaded 1.5 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/SuppDists_1.1-9.7.tgz'
Content type 'application/x-gzip' length 347527 bytes (339 KB)
==================================================
downloaded 339 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/kSamples_1.2-9.tgz'
Content type 'application/x-gzip' length 277455 bytes (270 KB)
==================================================
downloaded 270 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/BWStest_0.2.2.tgz'
Content type 'application/x-gzip' length 422680 bytes (412 KB)
==================================================
downloaded 412 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/mnormt_2.1.1.tgz'
Content type 'application/x-gzip' length 211871 bytes (206 KB)
==================================================
downloaded 206 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/commonmark_1.8.1.tgz'
Content type 'application/x-gzip' length 320304 bytes (312 KB)
==================================================
downloaded 312 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/reshape_0.8.9.tgz'
Content type 'application/x-gzip' length 168752 bytes (164 KB)
==================================================
downloaded 164 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/mc2d_0.1-21.tgz'
Content type 'application/x-gzip' length 1378438 bytes (1.3 MB)
==================================================
downloaded 1.3 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/gower_1.0.0.tgz'
Content type 'application/x-gzip' length 165389 bytes (161 KB)
==================================================
downloaded 161 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/hardhat_1.2.0.tgz'
Content type 'application/x-gzip' length 795388 bytes (776 KB)
==================================================
downloaded 776 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/ipred_0.9-13.tgz'
Content type 'application/x-gzip' length 384988 bytes (375 KB)
==================================================
downloaded 375 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/timeDate_4021.106.tgz'
Content type 'application/x-gzip' length 1579983 bytes (1.5 MB)
==================================================
downloaded 1.5 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/correlation_0.8.3.tgz'
Content type 'application/x-gzip' length 2528105 bytes (2.4 MB)
==================================================
downloaded 2.4 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/datawizard_0.6.3.tgz'
Content type 'application/x-gzip' length 1142513 bytes (1.1 MB)
==================================================
downloaded 1.1 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/insight_0.18.6.tgz'
Content type 'application/x-gzip' length 2004384 bytes (1.9 MB)
==================================================
downloaded 1.9 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/paletteer_1.5.0.tgz'
Content type 'application/x-gzip' length 432181 bytes (422 KB)
==================================================
downloaded 422 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/parameters_0.19.0.tgz'
Content type 'application/x-gzip' length 1861775 bytes (1.8 MB)
==================================================
downloaded 1.8 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/performance_0.10.0.tgz'
Content type 'application/x-gzip' length 3061327 bytes (2.9 MB)
==================================================
downloaded 2.9 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/statsExpressions_1.3.4.tgz'
Content type 'application/x-gzip' length 3392521 bytes (3.2 MB)
==================================================
downloaded 3.2 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/afex_1.1-1.tgz'
Content type 'application/x-gzip' length 2492600 bytes (2.4 MB)
==================================================
downloaded 2.4 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/BayesFactor_0.9.12-4.4.tgz'
Content type 'application/x-gzip' length 4278037 bytes (4.1 MB)
==================================================
downloaded 4.1 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/gapminder_0.3.0.tgz'
Content type 'application/x-gzip' length 2031842 bytes (1.9 MB)
==================================================
downloaded 1.9 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/ggcorrplot_0.1.4.tgz'
Content type 'application/x-gzip' length 28610 bytes (27 KB)
==================================================
downloaded 27 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/ggside_0.2.1.tgz'
Content type 'application/x-gzip' length 2954431 bytes (2.8 MB)
==================================================
downloaded 2.8 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/metaBMA_0.6.7.tgz'
Content type 'application/x-gzip' length 19001151 bytes (18.1 MB)
==================================================
downloaded 18.1 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/metafor_3.8-1.tgz'
Content type 'application/x-gzip' length 4479727 bytes (4.3 MB)
==================================================
downloaded 4.3 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/metaplus_1.0-4.tgz'
Content type 'application/x-gzip' length 469895 bytes (458 KB)
==================================================
downloaded 458 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/PMCMRplus_1.9.6.tgz'
Content type 'application/x-gzip' length 1221848 bytes (1.2 MB)
==================================================
downloaded 1.2 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/psych_2.2.9.tgz'
Content type 'application/x-gzip' length 3826607 bytes (3.6 MB)
==================================================
downloaded 3.6 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/spelling_2.2.tgz'
Content type 'application/x-gzip' length 52503 bytes (51 KB)
==================================================
downloaded 51 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/WRS2_1.1-4.tgz'
Content type 'application/x-gzip' length 965147 bytes (942 KB)
==================================================
downloaded 942 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/recipes_1.0.2.tgz'
Content type 'application/x-gzip' length 1475076 bytes (1.4 MB)
==================================================
downloaded 1.4 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/ggstatsplot_0.9.5.tgz'
Content type 'application/x-gzip' length 3422071 bytes (3.3 MB)
==================================================
downloaded 3.3 MB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/palmerpenguins_0.1.1.tgz'
Content type 'application/x-gzip' length 3003192 bytes (2.9 MB)
==================================================
downloaded 2.9 MB

The downloaded binary packages are in
    /var/folders/r1/3zp0c6w516g61fbl6pqcz7gr0000gn/T//RtmpKhjam5/downloaded_packages
installing the source package ‘lava’

trying URL 'https://cran.rstudio.com/src/contrib/lava_1.7.0.tar.gz'
Content type 'application/x-gzip' length 1106064 bytes (1.1 MB)
==================================================
downloaded 1.1 MB

* installing *source* package ‘lava’ ...
** package ‘lava’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** data
** demo
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (lava)

The downloaded source packages are in
    ‘/private/var/folders/r1/3zp0c6w516g61fbl6pqcz7gr0000gn/T/RtmpKhjam5/downloaded_packages’
  1. summary
summary()
  1. plot
  1. Histograms
hist(cats, breaks = "scott")
Error in hist.default(cats, breaks = "scott") : 'x' must be numeric
hist(pedes, breaks= "scott", prob = T)
lines(density(pedes))

Bivariate and Multivariate Statistics

  1. Plotting and Regression
  1. Box plotting

LS0tCnRpdGxlOiAiQklPTDQ4MDAvNjIyMF9GYWxsMjAyMl9SVHV0b3JpYWwiCm91dHB1dDoKICBwZGZfZG9jdW1lbnQ6IGRlZmF1bHQKICBodG1sX25vdGVib29rOiBkZWZhdWx0Ci0tLQoKIyBSIEJhc2ljCgojIyBJbnRyb2R1Y3Rpb24KCiMjIyBSIGFzIGEgY2FsY3VsYXRvcgoKYGBge3J9CjEgKyAxMDAKYGBgCgpgYGB7cn0KMl4yCmBgYAoKYGBge3J9CjcvMgpgYGAKCmBgYHtyfQo0LTEKYGBgCgpgYGB7cn0KMioyCmBgYAoKYGBge3J9CjMrNSoyCmBgYAoKYGBge3J9CigzKzUpKjIKYGBgCgpgYGB7cn0KMmUyCmBgYAoKYGBge3J9CjIvMTAwMDAKYGBgCgpgYGB7cn0Kc2luKDEpCmBgYAoKYGBge3J9CmxvZygxKQpgYGAKCmBgYHtyfQpleHAoMCkKYGBgCg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